package graphe;
import java.io.*;
import org.jdom.*;
import org.jdom.input.*;
import org.jdom.filter.*;
import java.util.List;
import java.util.Iterator;

@SuppressWarnings("unused")
public class JDOM {
	static org.jdom.Document document;
	 static Element racine;

	   public static void main(String[] args)
	   {
	      Graphe g=new Graphe();
	      g.Graphe_Parser("quartierFac.xml");
	      
	      /*for(int i=1;i<=9;i++)
	       * {
	    	  	System.out.println(g.getGraphe_tableRoutes().get(i));
	    	  	for(Point p: g.getGraphe_tableRoutes().get(i).getVecteurPoints())
	    	  	{
	    		  System.out.println(p);
	    	    }
	         }*/
	      g.Graphe_creationListeVoisins();
	      for(Route r : g.getGraphe_tableRoutes().values())
	      {
	    	  System.out.println(r.toString());
	    	  for(Point p : r.getVecteurPoints())
	    	  {
	    		  System.out.println(p.isIntersection());
	    		  p.Point_afficheListeVoisins();  
	    	  }
	      }
	   }
	   
	  
	@SuppressWarnings("unchecked")
	static void afficheAll(){
		   List<Element> listeRoutes=racine.getChildren("route");
		   List<Element> listeBatiments=racine.getChildren("batiment");
		   List<Element> listePoints;
		   List<Element> listeEntree;
		   
		   for(Element e: listeBatiments)
		   {
			   listeEntree=e.getChildren("entree");
		      System.out.println(e.getAttributeValue("nom"));
		      for(Element f:listeEntree)
		      {
		    	  System.out.println(f.getAttributeValue("num"));
		      }
		   }
	   }
	   

}
